﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks.Dataflow;

namespace NewSolution
{
    public class ConsoleBlock
    {
        public void ConsolePart(IEnumerable<(bool, int)> results)
        {
            foreach (var (result, frameNumber) in results)
            {
                if (!result)
                {
                    Console.WriteLine($"文件不同，第 {frameNumber} 帧不同");
                    return;
                }
            }
            Console.WriteLine("文件相同");
        }

        public ActionBlock<IEnumerable<(bool, int)>> CreateActionBlock()
        {
            return new ActionBlock<IEnumerable<(bool, int)>>(
                results => ConsolePart(results));
        }
    }
}